var PagingToolbarOldinitComponent = Ext.PagingToolbar.prototype.initComponent;
Ext.override(Ext.PagingToolbar, {
   pageCountSize:new Ext.data.SimpleStore({
				fields : ['abbr', 'state'],
				data : [['20', '20'], ['100', '100'],
						['1000', '1000'],['2000', '2000'], ['5000', '5000']]
			}),
	PageSizeFun : function(recond, pagetbr) {
		pagetbr.pageSize = recond;
		if (pagetbr.store.lastOptions) {
			if (pagetbr.store.lastOptions.params)
				pagetbr.store.lastOptions.params.limit = recond;
			else {
				pagetbr.store.lastOptions.params = {
					limit : recond
				};
			}
			pagetbr.store.load(pagetbr.store.lastOptions);
		} else
			pagetbr.store.load({
				params : {
					limit : recond
				}
			});

	},

	initComponent : function() {
		var comboPageSize = new Ext.form.ComboBox({
			store : this.pageCountSize,
			valueField : 'abbr',
			displayField : 'state',
			mode : 'local',
			triggerAction : 'all',
			width : 55,
			value : this.pageSize+'',
			editable : false,
			selectOnFocus : true
		});

		this.items = ['-', '每页共', comboPageSize, '条'];
		var psf = this.PageSizeFun;
		var pagetbr = this;
		comboPageSize.on("select", function(a, b, c) {
			psf(parseInt(a.getValue()), pagetbr);

		});
		pagetbr.store.on('beforeload',function(s,o){
            if(o.params&&o.params.limit){
             o.params.limit=pagetbr.pageSize;
            }
			
		});
		PagingToolbarOldinitComponent.call(this);

	}

});